﻿using System;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Abp.Application.Services.Dto;
using Abp.Extensions;
using LeadThing.AbpZeroTemplate.Files;
using LeadThing.AbpZeroTemplate.EntityFramework;

namespace LeadThing.AbpZeroTemplate.Files.EntityMapper.Files
{

    /// <summary>
    /// 文件的数据配置文件
    /// </summary>
    public class FileCfg : EntityTypeConfiguration<File>
    {
        /// <summary>
        ///  构造方法[默认链接字符串< see cref = "AbpZeroTemplateDbContext" /> ]
        /// </summary>
        public FileCfg()
        {
            ToTable("File", AbpZeroTemplateConsts.SchemaName.Basic);


            // 图片名称
            Property(a => a.Title).HasMaxLength(50);
            // 扩展名
            Property(a => a.Extension).HasMaxLength(20);
            // 文件路径
            Property(a => a.Url).HasMaxLength(500);

        }
    }
}